package morning.cat.springboot.demo.listener;

import morning.cat.springboot.demo.event.WorldApplicationEvent;
import morning.cat.springboot.demo.entity.User;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @describe: API方式监听事件
 * @author: morningcat.zhang
 * @date: 2019/3/4 2:41 PM
 */
@Component
public class WorldApplicationListener implements ApplicationListener<WorldApplicationEvent> {
    @Override
    public void onApplicationEvent(WorldApplicationEvent event) {
        User user = event.getParam();
        System.out.println(user);
    }
}
